<?php
session_start();

function admin_logueado(){
    
    
    
    if(isset($_SESSION['login_user'])){
        $usr=$_SESSION['login_user'];
        /*
        $dbname='em_bd.sqlite';
        $base=new SQLite3($dbname, 0666); 
         
         */
        include_once 'conectar_bd.php';
        $base=  conectar_solo_lectura();
        
        $sql="SELECT usuario, password FROM admin_user WHERE usuario='$usr'";
        $results = $base->query($sql);
        $row=$results->fetchArray();

        $login_session=$row['usuario'];

        return isset($login_session);
    }else{
        return false;
    }
}

//function logout($href){
/*
function logout(){
    alert('me quiero ir');
    if(session_destroy()){
        //header("Location: '$href'");
    }
}
 * */
 
?>
